package aspect;

import org.aspectj.lang.ProceedingJoinPoint;

import util.MD5Util;
import vo.Customer;

public class MD5Aspect {
	
	public void addbefor()
	{
		System.out.println("this is befor");
	}
    public Object addMd5(ProceedingJoinPoint point)
    {
    	
    	Object o = null;
    	System.out.println("this is around");
		try {
			Object[] args = point.getArgs();
			Customer customer = (Customer)args[0];
			customer.setPassword(MD5Util.string2MD5(customer.getPassword()));
			args[0]=customer;
			o = point.proceed(args);
		} catch (Throwable e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	return o;
    }
}
